In a 3D graphics processing system, objects of a scene are represented with groups of primitives, which are typically projected, scan converted, textured, and shaded during rendering of the scene. A primitive has a simple geometric shape, often a triangle, defined by the positions of one or more vertices (e.g. three vertices in the case that the primitive is a triangle) to which a texture can be applied. The rendering of a 3D scene processes the primitives to form an image comprising an array of image pixels. One step in the rendering process is to determine, for each of a plurality of sample positions of the image, which of the primitives is/are visible. This process is called hidden surface removal (HSR). Primitives, or parts of primitives, which are hidden by other primitives do not need to be considered further in the render. In order to perform HSR, the depths (i.e. the distances from the viewpoint) of primitives in the scene for each sample position are considered in order to determine which primitives are visible at each pixel position. Primitives may be opaque or translucent. A rendering technique in which textures are used to create holes in otherwise opaque primitives is known as “punch through”. For opaque primitives, the final rendered pixel value at a pixel position (which may correspond to one or more of the sample positions) will usually be given by the textured primitive which has the smallest depth value at that pixel position. For translucent primitives the final rendered pixel value at a pixel position may be given by a blend of more than one of the textured primitives which have the smallest depth values at that pixel position. When a scene contains primitives whose textures include punch through, the final rendered pixel value at a pixel position may be determined by primitives other than the primitive with the smallest depth value at that pixel position.
FIG. 1 shows a graphics processing system 100 comprising a processing module 102 which may be referred to as an Image Synthesis Processor (ISP), a depth buffer 104 which may be referred to as a Z-buffer, a tag sorter module 106, a texturing and shading engine 108 which may be referred to as a Unified Shading Cluster (USC), and a pixel buffer 110. In operation, primitives (e.g. vertex coordinates and primitive identifiers) are received at the ISP 102, and the ISP performs HSR on the primitives to determine which primitives are visible at each of a plurality of sample positions of the image to be rendered. In order to implement the HSR for a typical render, the ISP is programmed to store in depth buffer 104, for each sample position, a depth value representing the depth of the closest primitive which has been processed so far by the ISP 102, such that the ISP 102 can compare the depth of a primitive currently being processed with the depth values stored in the depth buffer 104 to determine whether the current primitive is visible. The results of the HSR performed by the ISP 102 are used to update the depth values stored in the depth buffer 104 accordingly. It is noted that in some systems, the depth buffer 104 and tag sorter module 106 may be described as components of the ISP 102.
The tag sorter module 106 comprises a tag buffer which is configured to store, for each sample position, a primitive identifier (ID) of a visible primitive at that sample position as determined by the HSR performed by the ISP 102. The tag sorter module 106 also comprises a controller to control the updating and flushing of the tag buffer. Primitive identifiers are flushed to the USC 108. In response to receiving the flushed primitive identifiers, the USC 108 will retrieve the identified primitives and will retrieve texture data in order to apply texturing and shading to the primitives identified by the flushed primitive IDs. The controller in the tag sorter module 106 controls when primitive identifiers are flushed to the USC 108. For example, primitive identifiers may be flushed to the USC 108 when the primitives for the image have all been processed by the ISP 102. Primitive identifiers may also be flushed to the USC 108 when primitive identifiers of translucent primitives, or primitives with texturing that includes punch through, are to be stored in the tag buffer. This is so that these primitives can be properly blended.